#!/usr/bin/env python
# encoding: utf-8
'''
@author: liuchong
@contact: lucas@007vin.com
@software: garner
@file: banzhou.py
@time: 2020/8/24 2:44 下午
@desc:
'''
import jieba
import re
def remove_tt(str1):
    a = re.findall('[\u4e00-\u9fa5a-zA-Z0-9]+',str1,re.S)   #只要字符串中的中文，字母，数字
    a = "".join(a)
    return  a


if __name__ == '__main__':
    s = '5 挡|变速器'
    print(remove_tt(s))
    print(s)
    # jieba.enable_paddle()# 启动paddle模式。 0.40版之后开始支持，早期版本不支持
    # strs=["KF,WC./2.2 升_5 缸_KF,WC.","T-DIESEL_5 缸_DIESEL,","5 缸_4-缸"]
    #
    # for str in strs:
    #     g = remove_tt(str)
    #     for key in ['4缸','5缸','6缸']:
    #         if g.find(key):
    #             print('exit')
    #
    # #     seg_list = jieba.cut_for_search(remove_tt(str)) # 使用paddle模式
    # #     print("Paddle Mode: " + '/'.join(list(seg_list)))
    #
    # seg_list = jieba.cut_for_search('KF,WC/2.2 升_KF,WC_5 缸')
    # print("Full Mode: " + ",".join(seg_list))  # 全模式
    # for str in strs:
    #     seg_list = jieba.cut(remove_tt(str), cut_all=False)
    #     print("Default Mode: " + "/ ".join(seg_list))  # 精确模式
    #
    # for str in strs:
    #     seg_list = jieba.cut(remove_tt(str))  # 默认是精确模式
    #     print(", ".join(seg_list))
    # for str in strs:
    #     seg_list = jieba.cut_for_search(remove_tt(str))  # 搜索引擎模式
    #     print(", ".join(seg_list))